/*
 * CfgFile.h
 *
 *  Created on: 2011-6-3
 *      Author: wugang
 */

#ifndef CFGFILE_H_
#define CFGFILE_H_

class CfgFile {
public:
	CfgFile();
	virtual ~CfgFile();
	static int readCfgfileString(const char *section, const char *key,char *value,
			int size, const char *default_value, const char *file);
	static int readCfgfileInt( const char *section, const char *key,int default_value,const char *file);

private:
	static int LoadIniFile(const char *file, char *buf,int *file_size);
	static int parseFile(const char *section, const char *key, const char *buf,int *sec_s,int *sec_e,
			int *key_s,int *key_e, int *value_s, int *value_e);
	static int newline(char c);
	static int endOfString(char c);
	static int leftBarce(char c);
	static int rightBrace(char c );
};

#endif /* CFGFILE_H_ */
